//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace EntLibContrib.Resource.Configuration.Design.Tests
{
	public static class ResourceAttributesHelper
	{
		public static bool AssertResourceDescription (Type type, string propertyName, string description)
		{
			PropertyInfo property = type.GetProperty(propertyName);
			ResourceDescriptionAttribute attribute = (ResourceDescriptionAttribute)property.GetCustomAttributes(typeof(ResourceDescriptionAttribute), false)[0];
			return description == attribute.Description;
		}

		public static bool AssertResourceCategory (Type type, string propertyName, string category)
		{
			PropertyInfo property = type.GetProperty(propertyName);
			ResourceCategoryAttribute attribute = (ResourceCategoryAttribute)property.GetCustomAttributes(typeof(ResourceCategoryAttribute), false)[0];
			return category == attribute.Category;
		}
	}
}